from database.exts import db


# class Instance(db.Model):
#     __tablename__ = 'instance'
#
#     id = db.Column(db.Integer, primary_key=True, autoincrement=True)
#     sceneId = db.Column(db.Integer)
#     isTraining = db.Column(db.Integer)
#     instanceName = db.Column(db.String(255))
#     createTime = db.Column(db.DateTime)
#     data_source_id = db.Column(db.Integer)


class Group(db.Model):
    __tablename__ = 'group'

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    group_name = db.Column(db.String(255))


class Edges(db.Model):
    __tablename__ = 'edges'

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    src = db.Column(db.Integer)
    dst = db.Column(db.Integer)


class Nodes(db.Model):
    __tablename__ = 'nodes'

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    node_name = db.Column(db.String(255))
    child_num = db.Column(db.Integer)
    group_id = db.Column(db.Integer)
    ncpus = db.Column(db.String(64))
    ngpus = db.Column(db.String(64))
    queue = db.Column(db.String(64))
    nnodes = db.Column(db.String(64))
    node_mem = db.Column(db.String(64))
    node_cpus = db.Column(db.String(64))
    node_cputype = db.Column(db.String(64))
    node_storage = db.Column(db.String(64))
    node_type = db.Column(db.String(64))
    node_os = db.Column(db.String(64))
    sccenter_name = db.Column(db.String(255))
    sccenter_location = db.Column(db.String(255))
    sc_user = db.Column(db.String(64))
    software = db.Column(db.String(64))
    software_version = db.Column(db.String(64))
    software_type = db.Column(db.String(255))
    software_outline = db.Column(db.String(64))
    service_type = db.Column(db.String(64))
    inputfiles_m = db.Column(db.String(255))
    inputdirs_o = db.Column(db.String(255))
    inputfiles_o = db.Column(db.String(511))
    limit_time = db.Column(db.String(255))
    outpath = db.Column(db.String(255))
    other = db.Column(db.String(255))
    file_name = db.Column(db.String(255))
    file_str = db.Column(db.Text)
